home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Arsenal Files 3
/
The Arsenal Files 3.iso
/
gen_prog
/
appdemo.exe
/
DEMOTSR1.APP
< prev
next >
Wrap
Text File
|
1994-11-07
|
975b
|
48 lines
#include "FILEIO.APP"
#include "TSR.APP"
#include "API.APP"
#include "STRING.APP"
#include "MAINLIB.APP" // MAINLIB.APP must always be last #include
// This TSR displays a file when you press ALT V
.STACKSIZE 2000
.STRINGHEAPSIZE 1000
int Main()
{
cout << "Press ALT V to view a file at any time\n";
TSRWithHotKey(2Fh,0,0,1,64); // ALT V Hot Key and reserve 64k dynamic RAM
return 0;
}
void TSRMain()
{
int ViewFile;
string Line;
Vdu.BackgroundColor = BLUE;
Vdu.ForegroundColor = YELLOW;
DrawBox(10,5,70,20);
Vdu.MinCol = 11;
Vdu.MinRow = 6;
Vdu.MaxCol = 69;
Vdu.MaxRow = 19;
cout << "File to view = ";
Line = InputLineWithDefault("DEMOTSR1.APP");
ViewFile = Open(Line, READ);
if(!ViewFile) { cout << "Could not open " << Line << "\n"; End(179); }
while(!EOF(ViewFile))
{
ViewFile >> Line;
cout << Line << "\n";
}
Close(ViewFile);
cout << "Please hit a key to continue";
GetChar(cin);
}